<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>OSCinit</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="oscilx.html" title="oscilx" />
    <link rel="next" href="OSClisten.html" title="OSClisten" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">OSCinit</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="oscilx.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="OSClisten.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="OSCinit"></a>
      <div class="titlepage"></div>
      <a id="IndexOSCinit" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">OSCinit</span>
        </h2>
        <p>OSCinit — 
      Start a listening process for OSC messages to a particular port.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp129690608"></a>
        <h2>Description</h2>
        <p>
      Starts a listening process, which can be used by OSClisten.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp129660032"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ihandle <span class="command"><strong>OSCinit</strong></span> iport</pre>
      </div>
      <div class="refsect1">
        <a id="idp129662240"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ihandle</em></span>
      -- handle returned that can be passed to any number of OSClisten
      opcodes to receive messages on this port.
    </p>
        <p>
      <span class="emphasis"><em>iport</em></span>
      -- the port on which to listen.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp129712256"></a>
        <h2>Performance</h2>
        <p>
    The listener runs in the background.  See OSClisten for details.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp129713408"></a>
        <h2>Example</h2>
        <p>
      The example shows a pair of floating point numbers being received
      on port 7770.
    </p>
        <div class="informalexample">
          <pre class="programlisting">
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 100
<span class="ohdr">nchnls</span> <span class="op">=</span> 2

gihandle <span class="opc">OSCinit</span> 7770

  <span class="oblock">instr</span>   1
    kf1 <span class="opc">init</span> 0
    kf2 <span class="opc">init</span> 0
<span class="olabel">nxtmsg</span>:
    kk  <span class="opc">OSClisten</span> gihandle, "/foo/bar", "ff", kf1, kf2
<span class="octrl">if</span> (kk <span class="op">==</span> 0) <span class="octrl">goto</span> <span class="olabel">ex</span>
    <span class="opc">printk</span> 0,kf1
    <span class="opc">printk</span> 0,kf2
    <span class="opc">kgoto</span> <span class="olabel">nxtmsg</span>
<span class="olabel">ex</span>:
  <span class="oblock">endin</span>
        </pre>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp129730768"></a>
        <h2>See Also</h2>
        <p>
        <a class="link" href="OSClisten.html" title="OSClisten"><em class="citetitle">OSClisten</em></a>,
        <a class="link" href="OSCsend.html" title="OSCsend"><em class="citetitle">OSCsend</em></a>
      </p>
        <p> More information on this opcode: <a class="ulink" href="http://www.youtube.com/watch?v=JX1C3TqP_9Y" target="_top"><em class="citetitle">http://www.youtube.com/watch?v=JX1C3TqP_9Y</em></a>  , made by Andrés Cabrera </p>
      </div>
      <div class="refsect1">
        <a id="idp129735232"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: John ffitch</td>
          </tr>
          <tr>
            <td>2005</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="oscilx.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="OSClisten.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">oscilx </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> OSClisten</td>
        </tr>
      </table>
    </div>
  </body>
</html>
